package com.zhuangyuan.cloud.core.filters;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.*;
import javax.servlet.FilterConfig;
import java.io.IOException;

/**
 * Created by 10191042 on 2019-09-24.
 */
public class ClientDeviceRequestFilter implements Filter {
    private static Logger logger = LoggerFactory.getLogger(ClientDeviceRequestFilter.class);

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        logger.info(String.format("=====Start init %s======",ClientDeviceRequestFilter.class.getSimpleName()));
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        logger.info(String.format("=====do filter in %s======",this.getClass().getSimpleName()));
        filterChain.doFilter(servletRequest,servletResponse);
    }

    @Override
    public void destroy() {

    }
}
